feat(plugins): add codex plugin package#894
Conversation
Signed-off-by: phernandez <paul@basicmachines.co>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 459366e1f3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "checkpoints" | ||
| ], | ||
| "skills": "./skills/", | ||
| "mcpServers": "./.mcp.json", |
There was a problem hiding this comment.
When this plugin is installed or just package-check-codex is run, the manifest points Codex and the validator at ./.mcp.json, but no such file is included in the new plugins/codex tree (I checked with rg --files plugins/codex .agents scripts | rg '(^|/)\.mcp\.json$|mcp'). The new validator then exits with Missing JSON file: /workspace/basic-memory/plugins/codex/.mcp.json, so the newly added package check fails and the plugin has no Basic Memory MCP server configuration to load.
Useful? React with 👍 / 👎.
|
Claude finished @phernandez's task in 2m 32s —— View job Code Review
SummaryThis PR adds a well-structured Codex-native plugin package for Basic Memory. The architecture is solid — proper hook scripts, validator, skills with frontmatter, schemas, and clean justfile integration. There is one critical blocker that mirrors what the Codex automated review flagged, plus a few minor items. Team Checklist
Critical Issue❌ P1: Missing
|
Signed-off-by: phernandez <paul@basicmachines.co>
|
Claude finished @phernandez's task in 2m 4s —— View job Code Review
|
| Area | Status | Notes |
|---|---|---|
| Coding conventions / 100-char lines | ✅ | Hook embedded Python is within limits |
| Python 3.12+ type annotations | ✅ | from __future__ import annotations in validator; hooks use inline Python |
| No commented-out code | ✅ | |
| Unit tests for new code | ✅ | tests/test_codex_plugin_package.py covers layout + behavioral contracts |
| 100% coverage maintained | ✅ | New tests cover the new package check logic; hook scripts are not in coverage scope |
| No hardcoded paths / secrets | ✅ | Confirmed clean — no /Users/, /home/, usernames |
| Console output — no emojis/unicode | ✅ | Hook output is plain ASCII |
| Windows path compatibility | ➖ | Hook scripts are .sh — Codex is Unix-only, acceptable |
plugins/codex/.mcp.json present and tracked |
✅ | Added in 092d2d7; test_codex_plugin_mcp_config_is_tracked_and_not_ignored enforces this |
| UTC timestamps in pre-compact.sh | ✅ | datetime.now(timezone.utc) + isoformat(timespec="seconds") — test asserts exact pattern |
| Session deduplication removed | ✅ | elif session_rows pattern replaces the invalid cross-type dedup; test asserts absence of old guard |
| Skill frontmatter (name/description) | ✅ | All 7 skills verified by validator and validator test |
| Schema frontmatter (type/entity) | ✅ | All 3 schemas pass validator |
| Hook scripts executable | ✅ | Validator checks os.access(script, os.X_OK) |
| Justfile integration | ✅ | package-check-codex wired into package-check |
CODEX_PLUGIN_VALIDATOR opt-in |
✅ | Clean pattern — required in CI, optional for contributors |
Findings
ℹ️ P3: .mcp.json uses basic-memory without a version pin
plugins/codex/.mcp.json:5:
"args": ["basic-memory", "mcp"]Running uvx basic-memory mcp (no @latest) uses whatever uvx has cached, which may be stale for a first-time install that hits a pre-existing cache entry. The bm-setup/SKILL.md:19 explicitly says the plugin starts uvx basic-memory mcp (no version), so this is consistent — but for a distributed plugin, basic-memory@latest would ensure a fresh resolve. Low risk since Codex users will typically have a recent install anyway.
ℹ️ P3: validate_codex_plugin.py hardcodes name == "codex" check
scripts/validate_codex_plugin.py:57:
if manifest.get("name") != "codex":
raise SystemExit(f"{manifest_path}: expected name=codex")This makes the validator Codex-specific rather than general-purpose. Fine for now since it's only wired to plugins/codex, but if the pattern expands to other Codex-family plugins, this will need to be parameterized. No action needed today.
ℹ️ P3: pre-compact.sh writes cwd into note frontmatter
plugins/codex/hooks/pre-compact.sh:157:
f"cwd: {cwd}",cwd is an absolute path from the Codex environment. This is fine for local use but in a shared/cloud Basic Memory project this leaks the user's filesystem layout into shared notes. Since bm-share (bm-share/SKILL.md) explicitly guards cross-project writes, this is low risk, but worth a comment in the code. No blocking concern.
✅ Previous Issues — All Resolved
The three issues flagged in the prior automated and Claude review are confirmed fixed:
| Issue | Fix | Verified by |
|---|---|---|
Missing .mcp.json |
Added in 092d2d7 |
test_codex_plugin_mcp_config_is_tracked_and_not_ignored |
Naive datetime.now() |
Changed to datetime.now(timezone.utc) + isoformat(timespec="seconds") |
test_codex_plugin_hooks_use_clear_portable_runtime_patterns |
| Cross-type dedup no-op | Removed; using elif session_rows pattern |
Same test, assert "if r not in codex_rows" not in session_start |
What Works Well
- Best-effort contract is solid across both hooks — every failure path exits 0.
shlex.split()forBM_BINcorrectly handles multi-word commands like"uv tool run basic-memory".ThreadPoolExecutorinsession-start.shwithmax_workers=4 + MAX_SHAREDis efficient and capped.- Validator is thorough — checks manifest, MCP config, hook executability, skill frontmatter, and schema
type/entity. - Focused test assertions in
test_codex_plugin_package.pypin behavioral contracts rather than just structure. bm-setup/SKILL.mdis notably detailed — structured interview flow, explicit confirmation before seeding schemas, verification step before finishing.
No merge blockers. The three previously identified issues are resolved. The notes above are all informational (P3) and don't require changes before merging.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 092d2d78a6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -0,0 +1,11 @@ | |||
| { | |||
| "mcpServers": { | |||
There was a problem hiding this comment.
Use Codex's supported MCP wrapper
For bundled Codex plugin MCP configs, the current OpenAI plugin docs accept either a direct server map or a wrapped mcp_servers object; this file uses the Claude-style mcpServers wrapper instead. In a Codex install this means basic-memory is not discovered as the bundled server, so the plugin's skills and setup instructions that rely on MCP start without the Basic Memory tools available. Make this a direct { "basic-memory": ... } map or use the documented mcp_servers wrapper.
Useful? React with 👍 / 👎.
Signed-off-by: phernandez <paul@basicmachines.co>
|
Claude finished @phernandez's task in 2m 27s —— View job Code Review
SummaryThis PR adds a well-structured Codex-native Basic Memory plugin. The previously-flagged critical blocker (missing There is one open question needing author clarification before merging, plus a few minor notes. Team Checklist
Open Question:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aa51d709d0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "hooks": { | ||
| "SessionStart": [ | ||
| { | ||
| "matcher": "startup|resume|compact", |
There was a problem hiding this comment.
Include clear sessions in the startup matcher
When a user starts a fresh context with /clear, Codex sends SessionStart with source clear (the hooks docs list startup|resume|clear|compact as the supported startup sources: https://developers.openai.ac.cn/codex/hooks#matcher-patterns). This matcher skips that case, so cleared sessions do not receive the Basic Memory orientation/setup nudge even though the plugin is intended to brief Codex at thread start; add clear to the matcher.
Useful? React with 👍 / 👎.
Signed-off-by: phernandez <paul@basicmachines.co>
|
Claude finished @phernandez's task in 2m 29s —— View job Code Review
SummaryThis PR adds a well-structured Codex-native Basic Memory plugin. Three of the four issues raised in prior automated reviews are confirmed resolved. There are two items needing attention before merging: the open Team Checklist
Items Needing Attention
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9259812a05
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| flag = "--project-id" if UUID_RE.match(project_ref) else "--project" | ||
| return [flag, project_ref] |
There was a problem hiding this comment.
Honor configured project routing in hooks
When bm-setup writes .codex/basic-memory.json with projectMode: "cloud" or "local", this helper still only adds --project/--project-id and never passes the CLI routing flag (--cloud/--local). In a repo mapped to a cloud project while the user's global Basic Memory mode remains local (or with same-named local/cloud projects), the SessionStart searches run against the wrong route or fail, so the plugin appears configured but loads no context; the PreCompact writer has the same omission when saving checkpoints.
Useful? React with 👍 / 👎.

Summary
Verification